/**
 * 
 */
function bind(fn, context) {
    var Slice = Array.prototype.slice,
        args = Slice.call(arguments, 2);
    return function() {
        var addArgs = Slice.call(arguments),
            allArgs = addArgs.concat(args);
        return fn.apply(context, allArgs);
    }
}

var demoData1 = {
        text: '第一组数据'
    },
    demoData2 = {
        text: '第二组数据'
    };
var bindFn = bind(demoFn, p, demoData1);

// 浏览器兼容
if (Function.prototype.bind === undefined) {
    Function.prototype.bind = function(context) {
        var Slice = Array.prototype.slice,
            args = Slice.call(arguments, 1),
            that = this;
        return function() {
            var addArgs = Slice.call(arguments),
                allArgs = args.concat(addArgs);
            return that.apply(context, allArgs);
        }
    }
}
